package mp.study.demo.controller;

import mp.study.demo.bean.User;
import mp.study.demo.service.UserService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 朝花不迟暮
 * @version 1.0
 * @date 2020/6/20 10:30
 */
@RestController
public class UserController
{
    private static final Log log= LogFactory.getLog(UserController.class);

    @Autowired
    private UserService userService;

    @GetMapping("/getUserList")
    public List<User> getUserList(){

        List<User> list = userService.list();
        log.info("user="+list);
        return list;
    }
}
